package top.abrsm.entity.bo;


import top.abrsm.entity.BaseEntity;

/**
 * 微信小程序获取手机号的解析实体
 */
public class WeChatPhoneBo extends BaseEntity {

    //包括敏感数据在内的完整用户信息的加密数据
    private String encryptedData;
    private String iv;//加密算法的初始向量
    private String sessionKey;//wx.login获取的sessionKey

    private String openId; // 打开小程序时获取的用户openid，通过通过打开视频传递过来的
    private String unionId;

    /**
     * 获取得到的开放数据为以下 json 结构：
     * {
     * "phoneNumber": "13580006666",
     * "purePhoneNumber": "13580006666",
     * "countryCode": "86",
     * "watermark":
     * {
     * "appid":"APPID",
     * "timestamp": TIMESTAMP
     * }
     * }
     */
    private String phoneNumber;// 获取的手机号
    private String purePhoneNumber; //没有区号的手机号
    private String countryCode; //区号

    public String getEncryptedData () {
        return encryptedData;
    }

    public void setEncryptedData ( String encryptedData ) {
        this.encryptedData = encryptedData;
    }

    public String getIv () {
        return iv;
    }

    public void setIv ( String iv ) {
        this.iv = iv;
    }

    public String getSessionKey () {
        return sessionKey;
    }

    public void setSessionKey ( String sessionKey ) {
        this.sessionKey = sessionKey;
    }

    public String getPhoneNumber () {
        return phoneNumber;
    }

    public void setPhoneNumber ( String phoneNumber ) {
        this.phoneNumber = phoneNumber;
    }

    public String getPurePhoneNumber () {
        return purePhoneNumber;
    }

    public void setPurePhoneNumber ( String purePhoneNumber ) {
        this.purePhoneNumber = purePhoneNumber;
    }

    public String getCountryCode () {
        return countryCode;
    }

    public void setCountryCode ( String countryCode ) {
        this.countryCode = countryCode;
    }

    public String getOpenId () {
        return openId;
    }

    public void setOpenId ( String openId ) {
        this.openId = openId;
    }

    public String getUnionId () {
        return unionId;
    }

    public void setUnionId ( String unionId ) {
        this.unionId = unionId;
    }

    @Override
    public String toString () {
        return "WeChatPhoneEntity{" +
                "encryptedData='" + encryptedData + '\'' +
                ", iv='" + iv + '\'' +
                ", sessionKey='" + sessionKey + '\'' +
                ", openId='" + openId + '\'' +
                ", unionId='" + unionId + '\'' +
                ", phoneNumber='" + phoneNumber + '\'' +
                ", purePhoneNumber='" + purePhoneNumber + '\'' +
                ", countryCode='" + countryCode + '\'' +
                '}';
    }
}
